/*
 * @Author: zjf
 * @Date: 2023-11-28 21:21:25
 * @LastEditors: zjf
 * @LastEditTime: 2023-12-09 18:08:33
 * @Description: 项目基本信息
 */
export const formColmuns = [
  { label: "项目名称", prop: "projectName", dataType: "input" },
  { label: "建设单位", prop: "constructionEntity", dataType: "input" },
  { label: "建设性质", prop: "constructionNature", dataType: "dataItem", dataCode: "constructionNature", },
  { label: '是否重点项目', prop: 'isKeyPrj', dataType: "radio", dataCode: "trueOrFalse", },
  { label: "工程类别", prop: "projectTypeId", dataType: "dataItem", dataCode: "worksCategory", },
  { label: "项目所在年度", prop: "projectYear", dataType: "input", append: "年", },
  // { label: "建设起止时间", prop: "projectStartEndDate", dataType: "yearRange" },
  { label: "建设起止时间", prop: "projectStartEndDate", prop1: "prjStartYear", prop2: "prjEndYear", dataType: "yearRange" },
  { label: "计划开工时间", prop: "planStartDate", dataType: "date", format: "yyyy-MM-dd", },
  { label: "计划竣工时间", prop: "planEndDate", dataType: "date", format: "yyyy-MM-dd", },
  { label: "所属区域", prop: "plate", dataType: "dataItem", dataCode: "subordinatePlate", },
  { label: "项目位置", prop: "projectLocation", dataType: "input" },
  { label: "是否属于娄江新城", prop: "isLjxc", dataType: "radio", dataCode: "trueOrFalse", },
  { label: "建设内容及规模", prop: "constructionContent", dataType: "input" },
  // { label: "项目等级", prop: "projectLevel", dataType: "dataItem", dataCode: "projectLevel", },
];

export const tableColmuns = [
  { label: '项目名称', prop: 'projectName', minWidth: 180, dataType: 'input'},
  { label: '建设单位', prop: 'constructionEntity', minWidth: 140, dataType: 'input', isNotAutoWrap: true },
  { label: '建设性质', prop: 'constructionNature', minWidth: 140, dataType: 'dataItem', dataCode: 'constructionNature' },
  { label: '是否重点项目', prop: 'isKeyPrj', minWidth: 140, dataType: 'boolean', isNotAutoWrap: true },
  { label: '工程类别', prop: 'projectTypeId', minWidth: 140, dataType: 'dataItem', dataCode: 'worksCategory' },
  { label: '项目所在年度', prop: 'projectYear', minWidth: 140, dataType: 'input', isNotAutoWrap: true },
  { label: '建设起止时间', prop: 'projectStartEndDate', minWidth: 140, dataType: 'input', isNotAutoWrap: true, append: "年", },
  { label: '计划开工时间', prop: 'planStartDate', minWidth: 140, dataType: 'datetime', format: 'yyyy-MM-dd', },
  { label: '计划竣工时间', prop: 'planEndDate', minWidth: 140, dataType: 'datetime', format: 'yyyy-MM-dd', },
  { label: '所属区域', prop: 'plate', minWidth: 150, dataType: 'dataItem', dataCode: 'subordinatePlate', isNotAutoWrap: true },
  { label: '项目位置', prop: 'projectLocation', minWidth: 140, dataType: 'input', isNotAutoWrap: true },
  { label: '是否属于娄江新城', prop: 'isLjxc', minWidth: 140, dataType: 'boolean', isNotAutoWrap: true },
  { label: '建设内容及规模', prop: 'constructionContent', minWidth: 140, dataType: 'input', isNotAutoWrap: true },
  // { label: '项目等级', prop: 'projectLevel', minWidth: 140, dataType: 'dataItem', dataCode: 'projectLevel' },
]

export const formData = {
  projectName: "",              // 项目名称
  constructionNature: "",       // 建设性质
  constructionEntity: "",       // 建设单位
  constructionContent: "",      // 建设内容及规
  // projectLevel: "",             // 项目等级
  projectTypeId: "",            // 工程类别
  projectYear: "",              // 项目所在年度

  projectStartEndDate: "",      // 建设起止时间
  prjStartYear: 0,
  prjEndYear: 0,

  planStartDate: "",            // 计划开工时间
  planEndDate: "",              // 计划竣工时间
  plate: "",                    // 所属区域
  projectLocation: "",          // 项目位置
  isLjxc: "",                   // 是否属于娄江新城
  isKeyPrj: "",                 // 是否重点项目
};

export const rules = {};

const api = window.$crud("project");

let config = {
  api: api,
  formColmuns: formColmuns,
  tableColmuns: tableColmuns,
  formData: formData,
  rules: rules,
  name: "基本信息",
  width: 125
};

export default config;
